<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  //     let arr = [
  //     {id: 1, name: '部门1', pid: 0},
  //     {id: 2, name: '部门2', pid: 1},
  //     {id: 3, name: '部门3', pid: 1},
  //     {id: 4, name: '部门4', pid: 3},
  //     {id: 5, name: '部门5', pid: 4},
  // ]

  //   function tranTree(){

  //   }

  var arr = [
    {
      name: "张三",
      value: "1"
    },
    {
      name: "李四",
      value: "2"
    },
    {
      name: "王五",
      value: "3"
    },
    {
      name: "马六",
      value: "4"
    }, {
      name: "陈七",
      value: "5"
    }
  ]
  var brr = [1, 2, 3, 4]

  crr = arr.filter((item, index) => {
    item.value != brr[index]
  })
  console.log(crr,arr);

</script>

</html>